#
# MAINTAINER        liufei <1197827920@qq.com>
# DOCKER-VERSION    17.12.1.ce
#
# Dockerizing maven: Dockerfile for building maven images
#
FROM       superliu/jdk:1.8.0
MAINTAINER liufei <1197827920@qq.com>

ENV MAVEN_VERSION 3.5.3
ENV MAVEN_HOME /opt/maven
ENV PROJECT_NAME p2p-service

# Install maven
# ADD http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz /opt/

COPY apache-maven-3.5.3-bin.tar.gz /opt/

RUN tar xzf /opt/apache-maven-3.5.3-bin.tar.gz -C /opt && \
    mv /opt/apache-maven-${MAVEN_VERSION} /opt/maven  && \
    ln -s /opt/maven/bin/mvn /usr/bin/mvn

COPY settings.xml /opt/maven/conf/settings.xml

ADD ${PROJECT_NAME} /${PROJECT_NAME}
RUN cd /${PROJECT_NAME} && \
    mvn clean install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
